{{#isArray}}
    {{#items}}
        (JsonSupport.of_list_of {{> to_json}})
    {{/items}}
{{/isArray}}
{{#isMap}}
    {{#items}}
        (JsonSupport.of_map_of {{> to_json}})
    {{/items}}
{{/isMap}}
{{^isContainer}}
    {{#isString}}JsonSupport.of_string{{/isString}}
    {{#isLong}}JsonSupport.of_int64{{/isLong}}
    {{#isInteger}}JsonSupport.of_int32{{/isInteger}}
    {{#isFloat}}JsonSupport.of_float{{/isFloat}}
    {{#isNumber}}JsonSupport.of_float{{/isNumber}}
    {{#isDouble}}JsonSupport.of_float{{/isDouble}}
    {{#isBoolean}}JsonSupport.of_bool{{/isBoolean}}
    {{^isEnum}}
        {{#isModel}}
            {{#vendorExtensions.x-model-module}}
                {{{vendorExtensions.x-model-module}}}.to_yojson
            {{/vendorExtensions.x-model-module}}
            {{^vendorExtensions.x-model-module}}
                {{{baseType}}}.to_yojson
            {{/vendorExtensions.x-model-module}}
        {{/isModel}}
    {{/isEnum}}
    {{^isModel}}
        {{^isContainer}}
            {{#isEnum}}
                Enums.{{{datatypeWithEnum}}}_to_yojson
            {{/isEnum}}
        {{/isContainer}}
    {{/isModel}}
    {{#isBinary}}JsonSupport.of_string{{/isBinary}}
    {{#isAnyType}}(fun x -> x){{/isAnyType}}
    {{#isFreeFormObject}}(fun x -> x){{/isFreeFormObject}}
{{/isContainer}}
